USE [C211391_CodexOmega_DB]
GO
/****** Object:  Table [dbo].[VideoCategory]    Script Date: 06/14/2009 08:57:45 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[VideoCategory](
	[VideoCategoryID] [int] IDENTITY(1,1) NOT NULL,
	[Definition] [nvarchar](255) NULL,
 CONSTRAINT [PK_VideoCategory] PRIMARY KEY CLUSTERED 
(
	[VideoCategoryID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[VideoLinker]    Script Date: 06/14/2009 08:57:45 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[VideoLinker](
	[VideoID] [int] IDENTITY(1,1) NOT NULL,
	[VideoCategoryID] [int] NOT NULL,
	[VideoTypeID] [int] NOT NULL,
	[Title] [nvarchar](255) NULL,
	[Description] [nvarchar](max) NULL,
	[Code] [nvarchar](max) NULL,
 CONSTRAINT [PK_VideoLinker] PRIMARY KEY CLUSTERED 
(
	[VideoID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[VideoType]    Script Date: 06/14/2009 08:57:45 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[VideoType](
	[VideoTypeID] [int] IDENTITY(1,1) NOT NULL,
	[Definition] [nvarchar](255) NULL,
 CONSTRAINT [PK_VideoType] PRIMARY KEY CLUSTERED 
(
	[VideoTypeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[VideoLinker]  WITH CHECK ADD  CONSTRAINT [FK_VideoLinker_VideoCategory] FOREIGN KEY([VideoCategoryID])
REFERENCES [dbo].[VideoCategory] ([VideoCategoryID])
GO
ALTER TABLE [dbo].[VideoLinker] CHECK CONSTRAINT [FK_VideoLinker_VideoCategory]
GO
ALTER TABLE [dbo].[VideoLinker]  WITH CHECK ADD  CONSTRAINT [FK_VideoLinker_VideoType] FOREIGN KEY([VideoTypeID])
REFERENCES [dbo].[VideoType] ([VideoTypeID])
GO
ALTER TABLE [dbo].[VideoLinker] CHECK CONSTRAINT [FK_VideoLinker_VideoType]